/**
 * Created by 王建 on 2017/6/20.
 */
layui.use(['form','element','laydate'],function () {
   var $=layui.jquery,form=layui.form(),element=layui.element(),laydate=layui.laydate;
    var path_=window.location.pathname;
    path_=path_.substring(0,path_.lastIndexOf("/")+1);
    var $ = layui.jquery, form = layui.form(),layer=layui.layer;
    var id=$("input[name='id']").val();
    if(""!=id&&0!=id){
        path_=path_.substring(0,path_.substring(0,path_.lastIndexOf("/")-1).lastIndexOf("/")+1);
    }
    $(".layui-form-pane").attr("action",path_+"save");
    var index = parent.layer.getFrameIndex(window.name);
    var info=$("input[name='button']").val();
    var msg=$("input[name='msg']").val();
    if(info=="false"&&''!=msg){
        parent.layer.msg(msg);
        parent.location.reload();
        parent.layer.close(index);
    }
    var start = {
        min: laydate.now()
        ,max: '2099-06-16 23:59:59'
        ,istoday: false
        ,choose: function(datas){
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        min: laydate.now()
        ,max: '2099-06-16 23:59:59'
        ,istoday: false
        ,choose: function(datas){
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
});
